#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include <assert.h>
#ifndef ___CONFIG______H__________
#define ___CONFIG______H__________
//#define TEST
#define DEBUG 1
#ifdef	DEBUG
#define	dbg_info(format, args...)	printf("%s(%d):"format"\n",__FILE__,__LINE__, ##args)
#else
#define	dbg_info(format, args...)
#endif
#define	dbg_error(format, args...)	printf("%s(%d):"format"\n",__FILE__,__LINE__, ##args)

#ifdef TEST
#define	EXC_RESULT(ret,func)    printf("exc %s  result:0\n",#func)
#else
#define EXC_RESULT(ret,func)    (ret) = (func);if(ret){printf("%s error result:%d\r\n",#func,(ret));return (ret);}
#endif
/*** constants ***/
#define SYSFS_PWM_DIR "/sys/class/pwm"

#define MAX_BUF 64
#define IN	  0x80
#define OUT	  0x40
#define PINMAX	223
#define PINMIN	0
#define GPIO_VALUE_0 0
#define GPIO_VALUE_1 1

#define SERVER_PORT = 9006;


#define	LW_GPIOA	28
#define	LW_GPIOB	29
#define	RW_GPIOA	 6    
#define	RW_GPIOB	 3
#define	LW_CAN		24
#define	RW_CAN		 5
#define	MAX_SPEED	100	
#define	LW_SPEED	 80	
#define RW_SPEED	 80	

//#define USE_PWM 0
#define	CTL_HAND_DEV	"/dev/ttyUSB0"
#define	MOTOR_0			 8
#define	MOTOR_1			 9
#define	MOTOR_2			10
#define	MOTOR_3			11
#define	MOTOR_4			12
#define	MOTOR_5			13
#define MOTOR_6			14

#define true 1
#define false 0
#endif

//RETURN CODE DEFINE
#define SUCCESS						0x0000
#define ERROR_PARAM					0x0001
#define ERROR_SEARIL_SEND			0x0002
